package com.quickfile.jrefilesystem;

import java.io.FileNotFoundException;
import java.io.IOException;
import java.nio.channels.FileChannel;

import com.quickfile.File;
import com.quickfile.FileInputStream;

public class FileInputStreamImpl extends FileInputStream {

	private java.io.FileInputStream fileInputStream;

	public FileInputStreamImpl(File file) throws FileNotFoundException {
		fileInputStream = new java.io.FileInputStream(((FileImpl) file).file);
	}

	public FileInputStreamImpl(String filepath) throws FileNotFoundException {
		fileInputStream = new java.io.FileInputStream(filepath);
	}

	@Override
	public int available() throws IOException {
		return fileInputStream.available();
	}

	@Override
	public void close() throws IOException {
		fileInputStream.close();
	}

	@Override
	public FileChannel getChannel() {
		return fileInputStream.getChannel();
	}

	@Override
	public int read() throws IOException {
		return fileInputStream.read();
	}

	@Override
	public int read(byte[] b) throws IOException {
		return fileInputStream.read(b);
	}

	@Override
	public int read(byte[] b, int off, int len) throws IOException {
		return fileInputStream.read(b, off, len);
	}

	@Override
	public long skip(long n) throws IOException {
		return fileInputStream.skip(n);
	}
}
